import request from '@/utils/request'

export function postLogin(account) {
  return request({
    method: 'post',
    url: '/login',
    data: account,
    timeout: 30000
  })
}

export function postRegister(account) {
  return request({
    method: 'post',
    url: '/register',
    data: account,
    timeout: 30000
  })
}

export function updateInfo(info) {
  return request({
    method: 'post',
    url: '/account',
    data: info
  })
}

export function deleteUser(userId) {
  return request({
    method: 'delete',
    url: '/account',
    data: { userId }
  })
}

export function updatePassword(userId, password, newPwd) {
  return request({
    method: 'post',
    url: '/updatePwd',
    data: { userId, password, newPwd }
  })
}
